<template>

  <div>

    <div>
        <el-steps :active="1" simple process-status=finish finish-status=success align-center space="15%">
          <el-step title="选择案件类型" icon="el-icon-edit"></el-step>
          <el-step title="利益冲突审查" icon="el-icon-edit"></el-step>
          <el-step title="新增委托人" icon="el-icon-edit"></el-step>
          <el-step title="登记立案信息" icon="el-icon-edit"></el-step>
          <el-step title="立案文书上传" icon="el-icon-edit"></el-step>
          <el-step title="收案审批" icon="el-icon-edit"></el-step>
        </el-steps>
    </div>


    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px"  class="app-container">
    <ul>
    <li class="dx">利益冲突审查</li>
  </ul>
      <el-form-item label="委托人/当事人证件号"  prop="ipaddr" label-width="200px">
        <el-input
          v-model="queryParams.cardnum"
          placeholder=""
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="对方当事人证件号" prop="userName" label-width="200px">
        <el-input
          v-model="queryParams.caseOppositeCardnum"
          placeholder=""
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="getList">立即检测</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>

    </el-form>

    <div>
        <el-button type="primary" v-show="v_show == 0" icon="el-icon-edit" @click="gotoUserclient">添加客户</el-button>
        <el-button type="danger" v-show="v_show > 0"  icon="el-icon-close">有利益冲突</el-button>
        <el-button type="success" v-show="v_show == 0" icon="el-icon-check">无利益冲突</el-button>
    </div>

    <el-table
      :data="list.slice((pageNum-1)*pageSize,pageNum*pageSize)"
      style="width: 100%;"
      class="app-container1" >
      <el-table-column label="案号" type="index" align="center"prop="caseNo" :show-overflow-tooltip="true" />
      <el-table-column label="当事人/委托人" align="center" prop="caseParties" :show-overflow-tooltip="true" />
      <el-table-column label="嫌疑人" align="center" prop="caseSuspect" :show-overflow-tooltip="true" />
      <el-table-column label="对方当事人" align="center" prop="caseOppositeParties" :show-overflow-tooltip="true" />
      <el-table-column label="承办律师" align="center" prop="caseAttorney" :show-overflow-tooltip="true" />
      <el-table-column label="案由" align="center" prop="caseCause" :show-overflow-tooltip="true" />
      <el-table-column label="收案日期" align="center" prop="collectionTime" :show-overflow-tooltip="true" />
      <el-table-column label="结案情况" align="center" prop="casePlan"  width="180":show-overflow-tooltip="true">
         <template slot-scope="scope">
          <span v-if="scope.row.casePlan=='A'">未结案</span>
          <span v-else>已结案</span>
        </template>
      </el-table-column>
      <el-table-column>
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.loginTime) }}</span>
        </template>
      </el-table-column>
    </el-table>

  </div>
</template>

<script>
import {listCaseExam} from "@/api/system/CaseExam.js";

export default {
  name: "Online",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 总条数
      total: 0,
      // 表格数据
      list: [],
      pageNum: 1,
      pageSize: 10,
      v_show:-1,
      // 查询参数
      queryParams: {
        cardnum:undefined,
        caseOppositeCardnum: undefined
      }
    };
  },
  methods: {
    /** 跳转添加委托人界面 */
    gotoUserclient() {
      this.$store.dispatch("tagsView/delView",this.$route);
      this.$router.push({name:"myUserclient"});
    },
    /** 查询登录日志列表 */
    getList() {
      this.loading = true;
      listCaseExam(this.queryParams).then(response => {
        this.list = response.rows;
        this.v_show = this.list.length
        this.total = response.total;
        this.loading = false;
      });
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    /** 强退按钮操作 */
    handleForceLogout(row) {
      this.$modal.confirm('是否确认强退名称为"' + row.userName + '"的用户？').then(function() {
        return forceLogout(row.tokenId);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("强退成功");
      }).catch(() => {});
    }
  }
};
</script>
<style scoped>
/* .app-container{
border-radius: 3px;
margin: 5px;
 height: 120px;
background-color: white;
box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;

} */
.app-container1{
width: 100%;
 margin: 5px;
  padding: 20px;
   box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;
background-color: white;
}

</style>

